package myoa.domain

import myoa.User
import myoa.tool.SessionTool

abstract class Trace {
    User createdBy
    Date dateCreated   //manage by grails
    User lastUpdatedBy
    Date lastUpdated   //manage by grails

    def traceCreate() {
        //todo research later: (unique:createdBy) and NonUniqueObjectException
        this.createdBy = User.get(SessionTool.loginUser.id)
        this.lastUpdatedBy = this.createdBy
    }

    def traceUpdate() {
        this.lastUpdatedBy = SessionTool.loginUser
    }
}
